# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1GcsIngestWithDocAiProcessorsPipeline do
  @moduledoc """
  The configuration of the Cloud Storage Ingestion with DocAI Processors pipeline.

  ## Attributes

  *   `extractProcessorInfos` (*type:* `list(GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1ProcessorInfo.t)`, *default:* `nil`) - The extract processors information. One matched extract processor will be used to process documents based on the classify processor result. If no classify processor is specified, the first extract processor will be used.
  *   `inputPath` (*type:* `String.t`, *default:* `nil`) - The input Cloud Storage folder. All files under this folder will be imported to Document Warehouse. Format: `gs:///`.
  *   `pipelineConfig` (*type:* `GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1IngestPipelineConfig.t`, *default:* `nil`) - Optional. The config for the Cloud Storage Ingestion with DocAI Processors pipeline. It provides additional customization options to run the pipeline and can be skipped if it is not applicable.
  *   `processorResultsFolderPath` (*type:* `String.t`, *default:* `nil`) - The Cloud Storage folder path used to store the raw results from processors. Format: `gs:///`.
  *   `skipIngestedDocuments` (*type:* `boolean()`, *default:* `nil`) - The flag whether to skip ingested documents. If it is set to true, documents in Cloud Storage contains key "status" with value "status=ingested" in custom metadata will be skipped to ingest.
  *   `splitClassifyProcessorInfo` (*type:* `GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1ProcessorInfo.t`, *default:* `nil`) - The split and classify processor information. The split and classify result will be used to find a matched extract processor.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :extractProcessorInfos =>
            list(
              GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1ProcessorInfo.t()
            )
            | nil,
          :inputPath => String.t() | nil,
          :pipelineConfig =>
            GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1IngestPipelineConfig.t()
            | nil,
          :processorResultsFolderPath => String.t() | nil,
          :skipIngestedDocuments => boolean() | nil,
          :splitClassifyProcessorInfo =>
            GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1ProcessorInfo.t()
            | nil
        }

  field(:extractProcessorInfos,
    as: GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1ProcessorInfo,
    type: :list
  )

  field(:inputPath)

  field(:pipelineConfig,
    as: GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1IngestPipelineConfig
  )

  field(:processorResultsFolderPath)
  field(:skipIngestedDocuments)

  field(:splitClassifyProcessorInfo,
    as: GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1ProcessorInfo
  )
end

defimpl Poison.Decoder,
  for:
    GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1GcsIngestWithDocAiProcessorsPipeline do
  def decode(value, options) do
    GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1GcsIngestWithDocAiProcessorsPipeline.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for:
    GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1GcsIngestWithDocAiProcessorsPipeline do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
